#include "common.h"

#include <QDir>

/*! @brief 工具集*/
namespace MyUtils {

    double      translate_lon(double lon, double lat);
    double      translate_lat(double lon, double lat);
    POSITION    wgs84togcj02(double wgs_lon, double wgs_lat);

    double      convertToDegree(double degreeMinute);

    bool        fileExists(const QString &filePath);

    bool        createFile(const QString &filePath);

    bool        dirExists(const QString &dirPath);

    bool        mkMultiDir(const QString &dirPath);

    uint16_t    CRC16(const uint8_t *tmp, int num);

    int         screenWidth();

    int         screenHeight();

    bool        checkNetworkConnection(const QString &ipAddress);

    bool        parseUploadResponse(const QString qstrResponse, const QString qstrType);

    bool        parseInvalidTokenJSON(const QString qstrResponse, int &p_errCode);

    bool        parseCalibrationUpload(const QString qstrResponse, QString &picPath);

    bool        parseCalibrationRes(QString qstrResponse, QString &message, QString &showUrl, QString &taskId);

    bool        parseConfirmCalibraRet(QString qstrResponse, QString &message, QString &taskId);

}
